package config

import (
	"dealcenter/utils/logx"
	"github.com/pkg/errors"
	"github.com/spf13/viper"
	"os"
)

func InitConf() {
	workDir, err := os.Getwd()
	if err != nil {
		panic(errors.Wrap(err, "[CONFIG]"))
	}
	viper.SetConfigName("config")
	viper.SetConfigType("yml")
	viper.AddConfigPath(workDir + "/config")
	if err = viper.ReadInConfig(); err != nil {
		panic(errors.Wrap(err, "[CONFIG]"))
	}
	logx.LogrusObj.Println("[CONFIG] version", viper.GetString("version"))
}
